// pages/contactService/index.js
const common = require('../../utils/common')
const {
  getHomeCustomer
} = require('../../services/home')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    info: {}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.hideShareMenu({});
    //获取客服信息
    this.requestToGetCustomer();
  },
  //获取客服信息
  requestToGetCustomer() {
    getHomeCustomer().then(res => {
      this.setData({
        info: res.data
      });
    }).catch(err => {
      common.log(err);
    })
  },

  onCopy() {
    wx.setClipboardData({
      data: this.data.info.wechatNo,
      success: res => {
        common.showToast("微信号已复制到剪贴板");
      }
    })
  },
})
